﻿using System;
namespace ArrayConsole
{
    public class Array
    {
        static void Main(string[] args)
        {
            int length;
            Console.WriteLine("输入数的个数：");
            length = Convert.ToInt32(Console.ReadLine());
            double[] array = new double[length];
            Console.WriteLine("输入一组数：");
            double  max = -1000, min = 1000, sum = 0;
            double avg;
            for(int i = 0; i < length; i++)
            {
                array[i] = Convert.ToDouble(Console.ReadLine());
                if(array[i] > max)
                {
                    max = array[i];
                }
                if(array[i] < min)
                {
                    min = array[i];
                }
                sum += array[i];
            }
            avg = sum / length;
            Console.WriteLine("数组的最大值为：" + max);
            Console.WriteLine("数组的最小值为：" + min);
            Console.WriteLine("数组的平均值为：" + avg);
            Console.WriteLine("数组的数据总和为：" + sum);

        }
    }
}